package com.huluobo.high3demo;

import android.app.Application;
import android.util.Log;

import com.huluobo.mvvm.utils.AppDBUtils;
import com.hyphenate.chat.EMClient;
import com.hyphenate.chat.EMOptions;
import com.tencent.live2.V2TXLivePremier;
import com.tencent.rtmp.TXLiveBase;
import com.umeng.commonsdk.UMConfigure;
import com.umeng.socialize.PlatformConfig;

/**
 * Created by LC on 2023/9/16.
 */
public class DouYinApp extends Application {
    @Override
    public void onCreate() {
        super.onCreate();

        //初始化本地数据库
        AppDBUtils.getInstance().init(this);
        //初始化友盟
        UMConfigure.init(this, "64e842c55488fe7b3afd2e0b"
                , "umeng", UMConfigure.DEVICE_TYPE_PHONE, "");
        // QQ设置
        PlatformConfig.setQQZone("254775", "228B9ED0421EB654C6C8B1FB3CB160DC");

        EMOptions options = new EMOptions();
        options.setAppKey("moroks#day10-im");
        EMClient.getInstance().init(this, options);

        String licenceURL = "https://license.vod2.myqcloud.com/license/v2/1252097114_1/v_cube.license"; // 获取到的
        // licence url
        String licenceKey = "9869d84b30d8f56360195eb86af68964"; // 获取到的 licence key
        TXLiveBase.getInstance().setLicence(this, licenceURL, licenceKey);
        V2TXLivePremier.setLicence(this, licenceURL, licenceKey);
        V2TXLivePremier.setObserver(new V2TXLivePremier.V2TXLivePremierObserver() {
            @Override
            public void onLicenceLoaded(int result, String reason) {
                Log.i("TagA","onLicenceLoaded: result:" + result + ", reason:" + reason);
            }
        });

    }
}
